$(function() {
	$("#Button2").bind("click", function() {
				document.location = context + "/site/companySupplier/11.jsp";
			});

	var id = getParameter("11-1.js", "id");

	new grooveTableSelector({
		id : id,
		tableName : "financialContract",
		handleType : "single",
		initFunc : function(contractBean) {
			new grooveTableSelector({
				id : contractBean.FC_INDENTID,
				tableName : "fcindent",
				handleType : "single",
				initFunc : function(indentBean) {
					new grooveTableSelector({
						id : contractBean.FC_APPLYID,
						tableName : "loanapply",
						handleType : "single",
						initFunc : function(applyBean) {
							new $.grooveView("addloanpayment", {
										formID : "formID",
										submitMessage : "确定提交支付",
										OKMessage : "成功完成订单支付",
										submitButtonID : "Button1",
										params : {
											contractNumber : contractBean.FC_NUMBER,
											contractDate : contractBean.FC_DATE,
											productName : contractBean.FC_FPNANE,
											currency : contractBean.FC_CURRENCY,
											credit : contractBean.FC_CREDITNAME,
											idnumber : indentBean.ID_NUMBER,
											totalpay : indentBean.ID_TOTALPAY,
											scale : applyBean.LA_MAXSCALE,
											replyamount : applyBean.LA_REPLYAMOUNT,
											duedate : applyBean.LA_DUEDATE,
											loanrate : applyBean.LA_LOANRATE,
											iaday : applyBean.LA_IADAY,
											interest : applyBean.LA_INTEREST,
											feerate : applyBean.LA_HANDINGFEERATE
										},
										beforecall : function() {
										},
										aftercall : function() {
											document.location = context
													+ "/site/companySupplier/11.jsp"
										},
										rendercall : function(selfFunc,
												validator, validators, data,
												dataBean) {

										}
									});
						}
					});

				}
			});
		}
	});

	$("#pageloading").hide();
});